//
//  TTWelconmeModel.m
//  TTWeibo
//
//  Created by 陶宏路 on 16/7/24.
//  Copyright © 2016年 陶路路. All rights reserved.
//

#import "TTWelconmeModel.h"

@implementation TTWelconmeModel

-(instancetype)initWithDictionary:(NSDictionary*)dic{
    
    if (self = [super init]) {
        
        [self setValuesForKeysWithDictionary:dic];
        
    }return self;
}

-(void)setExpires_in:(NSTimeInterval )expires_in{
    
    _expires_in = expires_in;
    
    self.created_at = [NSDate dateWithTimeIntervalSinceNow:expires_in];
    
}
-(void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
    
}


-(void)encodeWithCoder:(NSCoder *)aCoder{
    
    [aCoder encodeObject:self.access_token forKey:@"access_token"];
    [aCoder encodeObject:self.uid forKey:@"uid"];
    [aCoder encodeObject:self.screen_name forKey:@"screen_name"];
    [aCoder encodeObject:self.avatar_large forKey:@"avatar_large"];
    [aCoder encodeObject:self.created_at forKey:@"created_at"];
    
}

-(instancetype)initWithCoder:(NSCoder *)aDecoder{
    
    self.access_token = [aDecoder decodeObjectForKey:@"access_token"];
    self.uid = [aDecoder decodeObjectForKey:@"uid"];
    self.screen_name = [aDecoder decodeObjectForKey:@"screen_name"];
    self.avatar_large = [aDecoder decodeObjectForKey:@"avatar_large"];
    self.created_at = [aDecoder decodeObjectForKey:@"created_at"];
    
    return self;
}
@end
